package utils;

/**
 * 基于threadlocal封装工具类，用于保存和获取当前用户的登录id
 */
public class BaseContext {
    private static ThreadLocal<Long> threadLocal=new ThreadLocal<>();
    public static void setCurrentUserId(Long id){
        threadLocal.set(id);
    }
    public static Long getCurrentUserId(){
        return threadLocal.get();
    }
}